package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.CustomerChat;
import com.ruoyi.system.domain.CustomerInfo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Repository
public interface WaClientMapper {

    public List<CustomerChat> selectChatList(CustomerChat customerChat);

    public List<CustomerChat> selectChatListCusNumber(String[] contactNumber);

//    public List<CustomerInfo> selectChatListContactNumber(String contactNumber);

    public List<CustomerChat> selectToDayChatByIds(String contactNumber);

    public List<CustomerChat> selectConversionsByCode(CustomerChat customerChat);


    public List<CustomerChat> selectChatByIds(String[] ids);
//
    public CustomerChat selectChatByClientNumber(String customerNumber);

    public int updateCustomerChat(CustomerChat customerChat);

    public int updateCustomerByClientNumber(CustomerChat customerChat);

    /**
     * 新增客服信息
     *
     * @param user 客服信息
     * @return 结果
     */
    public int insertUser(CustomerChat user);

    /**
     * 批量删除客服信息
     *
     * @param customerNumber whatsapp号码
     * @return 结果
     */
    public int deleteUserByNumbers(String[] customerNumber);

    public CustomerChat selectChatById(String id);

    // 批量插入用户
    void batchInsertUsers(@Param("users") List<CustomerChat> users);

    // 批量查询客户聊天信息
    @MapKey("clientNumber")
    Map<String, CustomerChat> selectChatsByClientNumbers(@Param("clientNumbers") Set<String> clientNumbers);


    public int updateCustomerChatBycustomerNumber(CustomerChat customerChat);

    public int updateCustomerByStatus(CustomerChat customerChat);


    public List<CustomerChat> selectSendTotal(CustomerChat customerChat);
    public List<CustomerChat> selectToDaySendTotal(CustomerChat customerChat);
    public List<CustomerChat> selectClientTotal(CustomerChat customerChat);
    public List<CustomerChat> selectToDayClientTotal(CustomerChat customerChat);



}
